package com.orangeumbrella;

import com.guyj.base.ItemViewDelegate;
import com.guyj.base.ViewHolder;
import com.orangeumbrella.entity.EmergencyContactBean;

/**
 * 紧急联系人
 */
public class DelegateEmergencyContact implements ItemViewDelegate<Object> {

    @Override
    public int getItemViewLayoutId() {
        return R.layout.item_emergency_contact;
    }

    @Override
    public boolean isForViewType(Object o, int i) {
        return o instanceof EmergencyContactBean;
    }

    @Override
    public void convert(final ViewHolder viewHolder, Object o, int i) {
        viewHolder.setText(R.id.tv_name, ((EmergencyContactBean) o).getName());
        viewHolder.setText(R.id.tv_guanxi, ((EmergencyContactBean) o).getGuanxi());
        viewHolder.setText(R.id.tv_phone, ((EmergencyContactBean) o).getPhone());
    }
}
